<template>
    <div>
        Usre组件

        <br>
        获取user模块里面的state:{{ $store.state.user.count }}
        <br>

        <br>
        获取news模块里面的state:{{ $store.state.news.count }}
        <br>
        <br>
        <button @click="incCount">改变user模块里面的数据</button>
    </div>
</template>

<script>

import { defineComponent } from 'vue';

export default defineComponent({
    data() {
        return {

        }
    },
    methods: {
        incCount() {
            this.$store.commit("incCount")
        }
    }

})
</script>

<style lang="scss"></style>